using System;
using System.Collections.Generic;
using System.Text;

namespace CreamX.Core.TileMap
{
    
    public struct TileMapLocation : IEquatable<TileMapLocation>
    {
        /// <summary>
        /// A "null" MapLocation.
        /// </summary>
        public static TileMapLocation Empty = new TileMapLocation(-1, -1);

        /// <summary>
        /// X coordinate on tile grid.
        /// </summary>
        public int X;

        /// <summary>
        /// Y coordinate on tile grid.
        /// </summary>
        public int Y;

        /// <summary>
        /// Creates a MapLocation for a tile.
        /// </summary>
        /// <param name="x">X coordinate of tile</param>
        /// <param name="y">Y coordinate of tile</param>
        public TileMapLocation(int x, int y)
        {
            X = x;
            Y = y;
        }

        /// <summary>
        /// Determines whether MapLocations are equal.
        /// </summary>
        /// <param name="that">MapLocation to test</param>
        /// <returns>True if MapLocations refer to the same tile</returns>
        public bool Equals(TileMapLocation that)
        {
            return ((this.X == that.X) && (this.Y == that.Y));
        }

        /// <summary>
        /// Retrieves a string representation of the MapLocation.
        /// </summary>
        /// <returns>string representation of the MapLocation</returns>
        public override string ToString()
        {
            string value = "(" + X + "," + Y + ")";
            return value;
        }

        
    }
}
